package com.practice;

import java.util.Random;

public class demo15 {
    public static void main(String[] args) {
        //获取随机值
        Random r = new Random();
        for (int i = 0; i < 10; i++) {
            int age = r.nextInt(10, 81);
            System.out.println(age + ":" + (age < 18 ? "未成年" : (age > 55 ? "老年" : "青年")));
        }
    }
}
